package com.atguigu.spzx.manage.controller;

import com.atguigu.spzx.model.entity.system.Event;
import com.atguigu.spzx.model.vo.common.Result;
import com.atguigu.spzx.model.vo.common.ResultCodeEnum;
import com.atguigu.spzx.manage.service.ClientEventService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/client/system/event")
@Slf4j
@Tag(name = "client活动接口")
public class ClientEventController {
    private ClientEventService clientEventService;

    //查看热门活动四条
    @Autowired


    //查询is_up上架的所有轮播图
    @Operation(summary = "查看热门活动前四条")
    @GetMapping(value = "/getIsHotEventLimit4")
    public Result getIsHotEventLimit4() {
        List<Event> IsHotEventLimit4List= clientEventService.getIsHotEventLimit4();
        return Result.build(IsHotEventLimit4List, ResultCodeEnum.SUCCESS);
    }
    //查询is_up上架的所有轮播图
    @Operation(summary = "查看近期活动前四条")
    @GetMapping(value = "/getRecentEventLimit4")
    public Result getRecentEventLimit4() {
        List<Event> recentEventLimit4List= clientEventService.getRecentEventLimit4();
        return Result.build(recentEventLimit4List, ResultCodeEnum.SUCCESS);
    }

    @Operation(summary = "查看过去活动前四条")
    @GetMapping(value = "/getLateEventLimit4")
    public Result getLateEventLimit4() {
        List<Event> lateEventLimit4List= clientEventService.getLateEventLimit4();
        return Result.build(lateEventLimit4List, ResultCodeEnum.SUCCESS);
    }
}
